<template>
  <view class="container">
    <view v-if="evalstat==true">
      <view>
        <view class="cplistone">
          <view class="cpinfo Img">
            <image style="height: 135rpx;width: 135rpx" :src="AcceptEval.to_user_info.image_url"></image>
          </view>
          <view class="cpinfo df">
            <view class="title1">{{AcceptEval.evalinfo.title}}</view>
            <view class="title2">￥{{AcceptEval.evalinfo.frozen_money}}</view>
            <view v-if="AcceptEval.is_accept==4">
              <view class="invitation"
                    v-if="AcceptEval.order_info.type>2&&AcceptEval.order_info.type<4&&AcceptEval.order_info.appointment_time">
                <view class="title1">到店时间:{{AcceptEval.order_info.appointment_time|getTime}}</view>
              </view>
            </view>
          </view>
          <view class="cpinfo yuan">
            <view @click="toDetail" :data-evalid="AcceptEval.shop_evaluation_id"> →</view>
          </view>
        </view>
        <view class="cplisttow">
          <view class="dsone time">
            <view v-if="AcceptEval.is_accept ==0 || AcceptEval.is_accept ==1 || AcceptEval.is_accept ==4">
              <view v-if="AcceptEval.is_accept ==4 && AcceptEval.order_info.type>=8">

              </view>
              <view v-else>
              {{timeStr}}
              <view class="text" v-if="timeStr!='已过期'">将自动过期</view>
              </view>
            </view>
          </view>
          <view class="cplosrtress">
            <view class="dsone displayfb">
              <view class="invitation" v-if="AcceptEval.is_accept==0 && AcceptEval.user_id == uid">
                <a @click="toConfrim()">确认邀请</a>
              </view>
              <view class="invitation" v-if="AcceptEval.is_accept==0 && AcceptEval.user_id == uid">
                <a @click="toCancel()">拒绝邀请</a>
              </view>
            </view>
            <view class="dsone displayfb">
              <view class="invitation" v-if="AcceptEval.is_accept==0 && AcceptEval.to_user_id == uid">
                已邀请
              </view>
              <view class="invitation" v-if="AcceptEval.is_accept==1 && AcceptEval.to_user_id == uid">
                <a @click.stop="sureOrder" :data-id="AcceptEval.order_info.id"
                   :data-money="AcceptEval.order_info.money">确认付款</a>
              </view>
              <view class="invitation" v-if="AcceptEval.is_accept==1 && AcceptEval.user_id == uid">
                待商家付款
              </view>
              <view class="invitation" v-if="AcceptEval.is_accept==2 && AcceptEval.to_user_id == uid">
                已拒绝
              </view>
              <view class="invitation" v-if="AcceptEval.is_accept==2 && AcceptEval.user_id == uid">
                已拒绝
              </view>
              <view class="invitation" v-if="AcceptEval.is_accept==3">
                已过期
              </view>
              <view class="invitation"
                    v-if="AcceptEval.is_accept==4 && AcceptEval.to_user_id == uid && AcceptEval.order_info.type==1">
                待预约
              </view>

            </view>

            <!--          ==========================================商家按钮==================================================-->
            <view class="dsone displayfb" v-if="AcceptEval.is_accept ==4">
              <view class="invitation"
                    v-if="AcceptEval.order_info.type==2&&AcceptEval.order_info.appointment_time && AcceptEval.to_user_id == uid">
                <view class="operaBtn" @click.stop="sureAppoint" data-type="refuse"
                      :data-id="AcceptEval.order_info.id">
                  需要修改
                </view>
              </view>
            </view>
            <view class="dsone displayfb" v-if="AcceptEval.is_accept ==4">
              <view class="invitation"
                    v-if="AcceptEval.order_info.type==2&&AcceptEval.order_info.appointment_time && AcceptEval.to_user_id == uid">
                <view class="operaBtn" @click.stop="sureAppoint" data-type="pass"
                      :data-id="AcceptEval.order_info.id">
                  确认预约
                </view>
              </view>
            </view>
            <view class="dsone displayfb" v-if="AcceptEval.is_accept ==4">
              <view class="invitation"
                    v-if="AcceptEval.order_info.type==3&&!AcceptEval.order_info.arrival_image && AcceptEval.to_user_id == uid">
                <view class="operaBtn">待达人到店</view>
              </view>
            </view>
            <!--          商户type=4-->
            <view class="dsone displayfb" v-if="AcceptEval.is_accept ==4">
              <view class="invitation"
                    v-if="AcceptEval.order_info.type==4&& AcceptEval.to_user_id == uid">
                <view class="operaBtn">待交稿</view>
              </view>
            </view>
            <!--          商户type=5-->
            <view class="dsone displayfb" v-if="AcceptEval.is_accept ==4">
              <view class="invitation"
                    v-if="AcceptEval.order_info.type==5&& AcceptEval.to_user_id == uid">
                <view class="operaBtn" :data-type="AcceptEval.order_info.ext"
                      :data-id="AcceptEval.order_info.share_id" @click.stop="checkMsg">查看
                </view>
              </view>
            </view>

            <view class="dsone displayfb" v-if="AcceptEval.is_accept ==4">
              <view class="invitation"
                    v-if="AcceptEval.order_info.type==5&& AcceptEval.to_user_id == uid">
                <view class="operaBtn" @click.stop="surePass" data-type="refuse"
                      :data-id="AcceptEval.order_info.id">需修改
                </view>
              </view>
            </view>
            <view class="dsone displayfb" v-if="AcceptEval.is_accept ==4">
              <view class="invitation"
                    v-if="AcceptEval.order_info.type==5&& AcceptEval.to_user_id == uid">
                <view class="operaBtn" @click.stop="surePass" data-type="pass"
                      :data-id="AcceptEval.order_info.id">可发布
                </view>
              </view>
            </view>
            <!--          商户type=5-->
            <view class="dsone displayfb" v-if="AcceptEval.is_accept ==4">
              <view class="invitation"
                    v-if="AcceptEval.order_info.type==6&& AcceptEval.to_user_id == uid">
                <view class="operaBtn">待发布</view>
              </view>
            </view>
            <view class="dsone displayfb" v-if="AcceptEval.is_accept ==4">
              <view class="invitation"
                    v-if="AcceptEval.order_info.type==7&& AcceptEval.to_user_id == uid">
                <view class="operaBtn" @click.stop="noOver" :data-id="AcceptEval.order_info.id">稿件异常
                </view>
              </view>
            </view>
            <view class="dsone displayfb" v-if="AcceptEval.is_accept ==4">
              <view class="invitation"
                    v-if="AcceptEval.order_info.type==7&& AcceptEval.to_user_id == uid">
                <view class="operaBtn" @click.stop="sureOver" :data-id="AcceptEval.order_info.id">待发布
                </view>
              </view>
            </view>
            <view class="dsone displayfb" v-if="AcceptEval.is_accept ==4">
              <view class="invitation"
                    v-if="AcceptEval.order_info.type==8&& AcceptEval.to_user_id == uid">
                <view class="operaBtn">已完结</view>
              </view>
            </view>
            <!--            ==========================================用户按钮========================================================-->

            <view class="dsone displayfb" v-if="AcceptEval.is_accept ==4">
              <view class="invitation" v-if="AcceptEval.order_info.type==8&& AcceptEval.user_id == uid">
                <view class="operaBtn">已完结</view>
              </view>
            </view>
            <view class="dsone displayfb" v-if="AcceptEval.is_accept ==4">
              <view class="invitation" v-if="AcceptEval.order_info.type==7&& AcceptEval.user_id == uid">
                <view class="operaBtn">待商家查收</view>
              </view>
            </view>
            <view class="dsone displayfb" v-if="AcceptEval.is_accept ==4">
              <view class="invitation" v-if="AcceptEval.order_info.type==6&& AcceptEval.user_id == uid">
                <view class="operaBtn" @click.stop="sureRelease" :data-id="AcceptEval.order_info.id">发布
                </view>
              </view>
            </view>

            <view class="dsone displayfb" v-if="AcceptEval.is_accept ==4">
              <view class="invitation"
                    v-if="AcceptEval.order_info.type==4&& AcceptEval.user_id == uid && AcceptEval.order_info.share_id>0">
                <picker mode="date" :start="startTime" :end="endTime" @change="selectTime"
                        :data-pid="AcceptEval.order_info.shop_evaluation_id"
                        :data-id="AcceptEval.order_info.id">
                  <view class="operaBtn" :data-ids="AcceptEval.order_info.share_id"
                        :data-id="AcceptEval.order_info.id" @click.stop="toRelease">修改稿件
                  </view>
                </picker>
              </view>
            </view>
            <view class="dsone displayfb" v-if="AcceptEval.is_accept ==4">
              <view class="invitation"
                    v-if="AcceptEval.order_info.type==4&& AcceptEval.user_id == uid && AcceptEval.order_info.share_id==0">
                <picker mode="date" :start="startTime" :end="endTime" @change="selectTime"
                        :data-pid="AcceptEval.order_info.shop_evaluation_id"
                        :data-id="AcceptEval.order_info.id">
                  <view class="operaBtn" :data-id="AcceptEval.order_info.id" @click.stop="toRelease">
                    交稿
                  </view>
                </picker>
              </view>
            </view>

            <view class="dsone displayfb" v-if="AcceptEval.is_accept ==4">
              <view class="invitation"
                    v-if="AcceptEval.order_info.type==3&&AcceptEval.order_info.appointment_time && AcceptEval.user_id == uid">
                <picker mode="date" :start="startTime" :end="endTime" @change="selectTime"
                        :data-pid="AcceptEval.order_info.shop_evaluation_id"
                        :data-id="AcceptEval.order_info.id">
                  <view class="operaBtn">修改预约</view>
                </picker>
              </view>
            </view>
            <view class="dsone displayfb" v-if="AcceptEval.is_accept ==4">
              <view class="invitation"
                    v-if="AcceptEval.order_info.type==3&&AcceptEval.order_info.appointment_time && AcceptEval.user_id == uid">
                <view class="operaBtn" @click.stop="sureToStoreFun" :data-id="AcceptEval.order_info.id">
                  确认到店
                </view>
              </view>
            </view>
            <view class="dsone displayfb" v-if="AcceptEval.is_accept ==4">
              <view class="invitation" v-if="AcceptEval.order_info.type==5&& AcceptEval.user_id == uid">
                <view class="operaBtn">待审核</view>
              </view>
            </view>

            <view class="dsone displayfb" v-if="AcceptEval.is_accept ==4">
              <view class="invitation" v-if="AcceptEval.order_info.type==2&& AcceptEval.user_id == uid">
                <view class="operaBtn">待商家确认</view>
              </view>
            </view>

            <view class="dsone displayfb" v-if="AcceptEval.is_accept ==4">
              <view class="invitation"
                    v-if="AcceptEval.order_info.type==1&&!AcceptEval.order_info.appointment_time && AcceptEval.user_id == uid">
                <picker mode="date" :start="startTime" :end="endTime" @change="selectTime"
                        :data-pid="AcceptEval.order_info.shop_evaluation_id"
                        :data-id="AcceptEval.order_info.id">
                  <view class="operaBtn">预约到店</view>
                </picker>
              </view>
            </view>

          </view>
        </view>
      </view>
    </view>
    <!-- #ifdef MP-WEIXIN -->
    <!-- <tuicalling
    ref="TUICalling"
    id="TUICalling-component"
    :config="config">
  </tuicalling> -->
    <!-- #endif -->
    <!-- 		<view class="tui-chatroom-navigatorbar">
      <image class="tui-chatroom-navigatorbar-back" src="/static/static/assets/ic_back_white.svg" @tap="goBack" /> -->
    <!-- 先查 remark；无 remark 查 (c2c)nick/(group)name；最后查 (c2c)userID/(group)groupID -->
    <!-- <view class="conversation-title">{{ conversationName }}</view>
    </view> -->
    <!-- <view class="group-profile"><TUI-group-profile v-if="isShow" id="groip-profile" :conversation="conversation" /></view> -->
    <view class="message-list" @tap="triggerClose">

      <TUI-message-list id="message-list" ref="messageList" :conversation="conversation"/>
    </view>
    <view v-if="videoPlay" class="container-box" @tap.stop="stopVideoHander">
      <video v-if="videoPlay" class="video-message" :src="videoMessage.payload.videoUrl"
             :poster="videoMessage.payload.thumbUrl" object-fit="cover" error="videoError" autoplay="true"
             direction="0"/>
    </view>
    <view v-if="showChat" class="message-input">
      <!--			<TUI-message-input id="message-input" ref="messageInput" :orderinf="orderinf"  :conversation="conversation" :user_id="userID" @sendMessage="sendMessage" />-->
      <TUI-message-input id="message-input" @showAccept="showAccept" ref="messageInput" :orderinf="orderinf"
                         :ordersel="ordersel" :conversation="conversation" :user_id="userID"
                         @sendMessage="sendMessage"/>
    </view>
    <view class="addBox" @click="handleOrderList">
      <span>订单列表</span>
    </view>
    <number-jpan :length="6" @closeChange="closeChange($event)" :showNum="false" ref="numberPad"></number-jpan>
    <u-toast ref="uToast"/>
  </view>
</template>

<script>
import TIM from 'tim-wx-sdk';
import TUIMessageList from '../../components/tui-chat/message-list/index';
import TUIMessageInput from '../../components/tui-chat/message-input/index';
// import TUIGroupProfile from '../../components/tui-group/group-profile/index';
import {
  setTokenStorage
} from '../../utils/token';

const {
  getTokenStorage
} = require('../../utils/token.js');
import {
  genTestUserSig
} from '../../debug/GenerateTestUserSig.js';
import {
  wxPayment,
  zfbPayment
} from "@/utils/app.js";
import numberJpan from "@/components/numberJpan/numberJpan.vue";

const app = getApp();
export default {
  components: {
    TUIMessageList,
    TUIMessageInput,
    'number-jpan': numberJpan
    // TUIGroupProfile
  },
  props: {},
  data() {
    return {
      conversationName: '',
      conversation: {},
      messageList: [],
      StepDescribeList: [],
      isShow: false,
      showChat: true,
      conversationID: '',
      videoPlay: false,
      videoMessage: {},
      userID: "",
      toOtheruser_id: "",
      ordersel: "",
      evalorder_id: "",
      eval_orderid: "",
      order_id: "",
      bao: 0, //报名
      orderinf: {},
      config: {
        sdkAppID: '',
        userID: '',
        userSig: '',
        type: 1,
        tim: null
      },
      evalstat: false,
      AcceptEval: {},
      uid: uni.getStorageSync("userId"),
      timeStr: 0,
      daotime: 0,
      updateAcceptTimes: null
    };
  },
  created() {
    uni.$on('videoPlayerHandler', value => {
      this.videoPlay = value.isPlay;
      this.videoMessage = value.message;
    });
  },


  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    if (getApp().globalData.isSDKReady === false) {
      app.$vm.liaotianLogin();
    } else {
      this.setData({
        conversationID: options.conversationID,
        toOtheruser_id: options.user_ID,
        userID: uni.getStorageSync("userId").toString(),
        //订单信息(订单列表进来的)
        ordersel: options.ordersel,
        evalorder_id: options.evalorder_id,
        //测评信息(发送邀请)
        evalinfo_id: options.evalinfo_id,
        //报名进来的
        bao: options.bao
      });
      //获取订单信息
      if (options.evalorder_id) {
        this.getorderInfo(options.evalorder_id, options.bao);
      }
      //获取测评信息
      if (options.evalinfo_id) {
        this.getEvalInfo(options.evalinfo_id);
      }
      if (options.user_ID) {
        this.getuserProfile();
      }
      //更新用户聊天信息
      this.ltUpdateMyInfo();
    }
    //清除消息记录
    // let user_id =  this.conversationID.slice(3);
    // uni.removeStorageSync("chat"+user_id);
    uni.$TUIKit
        .setMessageRead({
          conversationID: this.conversationID
        })
        .then(() => {
        });
    uni.$TUIKit.getConversationProfile(this.conversationID).then(res => {
      const {
        conversation
      } = res.data;
      this.conversation = conversation;
      this.setData({
        conversationName: this.getConversationName(conversation),
        isShow: conversation.type === 'GROUP'
      });
      wx.setNavigationBarTitle({
        title: this.getConversationName(conversation),
        isShow: conversation.type === 'GROUP'
      })
    });
    //获取俩人直接是否有订单往来
    this.getAcceptEval();
    // this.updateAcceptData();
  },
  watch: { //监听时间的变化
  },
  mounted() {
    this.Time() //调用定时器
    this.updateAcceptData() //定时刷新浮窗
  },
  onUnload() {
    // #ifdef MP-WEIXIN
    //   this.$refs.TUICalling.destroyed();
    // // #endif
    if (this.updateAcceptTimes) {
      clearInterval(this.updateAcceptTimes);
      this.updateAcceptTimes = null;
    }
    //销毁聊天推送消息
    let toOtheruser_id = this.conversationID.slice(3);
    uni.removeStorageSync("chat" + toOtheruser_id);
  },
  methods: {
    getAcceptEval() {
      let obj = {};
      obj.user_id = uni.getStorageSync("userId");
      let toOtheruser_id = this.conversationID.slice(3);
      obj.otheruid = toOtheruser_id;
      this.$u.api.getAcceptEval(obj).then(res => {
        if (res.message == '获取成功') {
          res.data.to_user_info.image_url = this.getImage(res.data.to_user_info.image_url);
          this.setData({
            AcceptEval: res.data,
            evalstat: true
          })
          let upTime = new Date().getTime() / 1000;
          let times = "";
          if (res.data.is_accept == 0 || res.data.is_accept == 1 || res.data.is_accept == 4) {
            if (res.data.order_info.type == 0) {
              times = res.data.timelog.type0_time;
            } else if (res.data.order_info.type == 1) {
              times = res.data.timelog.type1_time;
            } else if (res.data.order_info.type == 2) {
              times = res.data.timelog.type2_time;
            } else if (res.data.order_info.type == 3) {
              times = res.data.timelog.type3_time;
            } else if (res.data.order_info.type == 4) {
              times = res.data.timelog.type4_time;
            } else if (res.data.order_info.type == 5) {
              times = res.data.timelog.type5_time;
            } else if (res.data.order_info.type == 6) {
              times = res.data.timelog.type6_time;
            } else if (res.data.order_info.type == 7) {
              times = res.data.timelog.type7_time;
            } else if (res.data.order_info.type == 8) {
              times = res.data.timelog.type8_time;
            } else {
              times = this.AcceptEval.create_time;
            }
          }
          // let times = this.AcceptEval.create_time;
          //设置倒计时
          this.seconds = Math.floor((times + 172800 - upTime));
          this.countDown();
        }
      })
    },
    showAccept(data) {
      if (data == 1) {
        this.getAcceptEval();
      }
    },

    // 天 时 分 秒 格式化函数
    countDown() {
      if (this.seconds < 1) {
        this.timeStr = "已过期"
      } else {
        let d = parseInt(this.seconds / (24 * 60 * 60))
        d = d < 10 ? "0" + d : d
        let h = parseInt(this.seconds / (60 * 60) % 24);
        h = h < 10 ? "0" + h : h
        let m = parseInt(this.seconds / 60 % 60);
        m = m < 10 ? "0" + m : m
        let s = parseInt(this.seconds % 60);
        s = s < 10 ? "0" + s : s
        this.timeStr = d + '天' + h + '时' + m + '分' + s + '秒'
      }
    },
    //定时器没过1秒参数减1
    Time() {
      setInterval(() => {
        this.seconds -= 1
        this.countDown()
      }, 1000)
    },

    //定时器没过1秒参数减1
    updateAcceptData() {
      this.updateAcceptTimes = setInterval(() => {
        this.daotime += 1
        if (this.daotime == 15) {
          this.getAcceptEval()
          this.daotime = 0;
        }
        // console.log(this.daotime)
      }, 1000)
    },

    //跳转订单列表
    handleOrderList() {
      let AcceptEval = this.AcceptEval;
      if (AcceptEval.to_user_id == uni.getStorageSync("userId")) {
        //商户
        if (AcceptEval.countnum > 1) {
          uni.navigateTo({ //商家
            url: "/pages/pagethree/pages/myCreation/myCreation?form=shop&type=0&otheruid=" +
                AcceptEval.user_id
          })
        } else {
          uni.navigateTo({ //商家
            url: "/pages/pagethree/pages/myCreation/myCreation?form=shop&type=0"
          })
        }
      } else {
        //用户
        if (AcceptEval.countnum > 1) {
          uni.navigateTo({ //达人
            url: "/pages/pagethree/pages/myCreation/myCreation?form=user&type=0&otheruid=" +
                AcceptEval.to_user_id
          })
        } else {
          uni.navigateTo({ //达人
            url: "/pages/pagethree/pages/myCreation/myCreation?form=user&type=0"
          })
        }
      }

      //判断身份
      // if (uni.getStorageSync('identity') == true) {
      // 	uni.navigateTo({ //商家
      // 		url: "/pages/pagethree/pages/myCreation/myCreation?form=shop&type=0"
      // 	})
      // } else {
      // 	uni.navigateTo({ //达人
      // 		url: "/pages/pagethree/pages/myCreation/myCreation?form=user&type=0"
      // 	})
      // }
    },

    //跳转详情
    toDetail(e) {
      let eval_id = e.currentTarget.dataset.evalid;
      uni.navigateTo({
        url: "/pages/pageone/pages/ActivityDetails/ActivityDetails?id=" + eval_id
      })
    },
    //订单详情
    getorderInfo() {
      let obj = {};
      let orderInf = {}
      let bao = this.bao;
      obj.order_id = this.evalorder_id;
      let Eval = this.AcceptEval;
      this.$u.api.getorderevalinfo(obj).then(res => {
        this.info = res.data;
        console.log(this.info)
        if (bao == 1) {
          orderInf = {
            orderNum: this.info.order_number,
            time: this.info.create_time,
            title: this.info.title,
            description: '测评信息',
            imageUrl: this.info.image_url ? this.info.image_url :
                'https://sdk-web-1252463788.cos.ap-hongkong.myqcloud.com/component/TUIKit/assets/miles.jpeg',
            price: this.info.money + '元',
            // comurl:'/pages/pageone/pages/ActivityDetails/ActivityDetails?shareid=' + uni.getStorageSync("userId") +
            //     "&cpid=" + this.info.shop_evaluation_id,
            // upurl:"/pages/pagefour/pages/releaseEva/releaseEva?id="+this.info.shop_evaluation_id,
            state: 2,
            toOtheruser_id: this.toOtheruser_id,
            user_id: uni.getStorageSync("userId"),
            shop_evaluation_id: this.info.shop_evaluation_id,
            types: Eval.is_accept,
            order_id: this.info.id,
            money: this.info.money,
            bao: bao
          }
        } else {
          orderInf = {
            orderNum: this.info.order_number,
            time: this.info.create_time,
            title: this.info.title,
            description: '测评信息',
            imageUrl: this.info.image_url ? this.info.image_url :
                'https://sdk-web-1252463788.cos.ap-hongkong.myqcloud.com/component/TUIKit/assets/miles.jpeg',
            price: this.info.money + '元',
            // comurl:'/pages/pageone/pages/ActivityDetails/ActivityDetails?shareid=' + uni.getStorageSync("userId") +
            //     "&cpid=" + this.info.shop_evaluation_id,
            // upurl:"/pages/pagefour/pages/releaseEva/releaseEva?id="+this.info.shop_evaluation_id,
            state: 2,
            toOtheruser_id: this.toOtheruser_id,
            user_id: uni.getStorageSync("userId"),
            shop_evaluation_id: this.info.shop_evaluation_id,
            types: 0,
            order_id: 0,
            money: 0,
            bao: bao
          }
        }
        console.log(orderInf)
        this.setData({
          orderinf: orderInf
        })
      })
    },
    //测评信息详情
    getEvalInfo() {
      let obj = {};
      let orderInf = {};
      let Eval = this.AcceptEval;
      obj.id = this.evalinfo_id;
      this.$u.api.shopEvaluationDetails(obj).then(res => {
        this.info = res.list;
        if (!Eval.is_accept || Eval.is_accept == 'undefined') {
          orderInf = {
            // orderNum: this.info.order_number,
            // time: this.info.create_time,
            title: this.info.title,
            description: '测评信息',
            imageUrl: this.info.ShopEvaluationExampleImage[0].image_value ? this.info
                    .ShopEvaluationExampleImage[0].image_value :
                'https://sdk-web-1252463788.cos.ap-hongkong.myqcloud.com/component/TUIKit/assets/miles.jpeg',
            price: this.info.talent_money + '元',
            confirm: this.info.id + '&' + uni.getStorageSync("userId") + '&' + 1,
            cancel: this.info.id + '&' + uni.getStorageSync("userId") + '&' + 2,
            state: 1,
            toOtheruser_id: this.toOtheruser_id,
            user_id: uni.getStorageSync("userId"),
            shop_evaluation_id: this.info.id,
            types: 0,
            order_id: 0,
            money: 0,
          }
        } else {
          orderInf = {
            // orderNum: this.info.order_number,
            // time: this.info.create_time,
            title: this.info.title,
            description: '测评信息',
            imageUrl: this.info.ShopEvaluationExampleImage[0].image_value ? this.info
                    .ShopEvaluationExampleImage[0].image_value :
                'https://sdk-web-1252463788.cos.ap-hongkong.myqcloud.com/component/TUIKit/assets/miles.jpeg',
            price: this.info.talent_money + '元',
            confirm: this.info.id + '&' + uni.getStorageSync("userId") + '&' + 1,
            cancel: this.info.id + '&' + uni.getStorageSync("userId") + '&' + 2,
            state: 1,
            toOtheruser_id: this.toOtheruser_id,
            user_id: uni.getStorageSync("userId"),
            shop_evaluation_id: this.info.id,
            types: Eval.is_accept,
            order_id: Eval.order_info.id,
            money: Eval.order_info.money,
          }
        }
        this.setData({
          orderinf: orderInf
        })
      })
    },

    getuserProfile() {
      // return;
      uni.$TUIKit
          .getUserProfile({
            userIDList: [this.toOtheruser_id]
          })
          .then(imRes => {
            if (imRes.code == 0) {
              this.setData({
                searchUser: imRes.data[0]
              });
            } else {
              uni.showToast({
                title: '该用户暂未注册IM系统,待用户登录后进行聊天',
                icon: 'error'
              });
              this.setData({
                userID: ''
              });
            }
          });
    },

    stopVideoHander() {
      this.videoPlay = false;
    },
    getConversationName(conversation) {
      if (conversation.type === '@TIM#SYSTEM') {
        this.setData({
          showChat: false
        });
        return '系统通知';
      }

      if (conversation.type === 'C2C') {
        return conversation.remark || conversation.userProfile.nick || conversation.userProfile.userID;
      }

      if (conversation.type === 'GROUP') {
        return conversation.groupProfile.name || conversation.groupProfile.groupID;
      }
    },

    sendMessage(event) {
      let user_id = this.conversationID.slice(3);
      if (!uni.getStorageSync("chat" + user_id)) { //推送
        uni.setStorageSync("chat" + user_id, true);
        let me = uni.getStorageSync("userId")
        let rmUser = uni.getStorageSync("rmUser")
        let obj = {};
        obj.user_id = user_id;
        obj.title = "聊天消息";
        obj.content = rmUser.username + '发来消息,点击查看消息内容';
        obj.payload = `/pages/TUI-Chat/chat?conversationID=C2C${me}` + `&user_ID=` + me;
        app.$vm.sendPushMes(obj);
      }
      // 将自己发送的消息写进消息列表里面
      this.$refs.messageList.updateMessageList(event.detail.message);
    },

    triggerClose() {
      if (this.showChat) {
        this.$refs.messageInput.handleClose();
      }
    },

    goBack() {
      const pages = getCurrentPages(); // 当前页面栈

      if (
          pages[pages.length - 2].route === 'pages/TUI-Conversation/create-conversation/create'
          // pages[pages.length - 2].route === 'pages/TUI-Group/create-group/create' ||
          // pages[pages.length - 2].route === 'pages/TUI-Group/join-group/join'
      ) {
        uni.navigateBack({
          delta: 2
        });
      } else {
        uni.navigateBack({
          delta: 1
        });
      }

      uni.$TUIKit
          .setMessageRead({
            conversationID: this.conversationID
          })
          .then(() => {
          });
    },

    //进入聊天页进行登录
    login(userID) {
      const userSig = genTestUserSig(userID).userSig;
      const SDKAppID = app.globalData.SDKAppID;
      uni.$TUIKit.login({
        userID: userID,
        userSig: userSig
      })
          .then(function (imResponse) { // 登录成功
            if (imResponse.data.repeatLogin === true) {
              // 标识帐号已登录，本次登录操作为重复登录。v2.5.1 起支持
            }
          })
          .catch(function (imError) {
            console.warn('login error:', imError); // 登录失败的相关信息
          });

    },
    getImage(url) {
      if (url && (url.indexOf("http://") != -1 || url.indexOf("https://") != -1)) {
        return url;
      } else {
        return app.$vm.globalData.imgBaseUrl + url;
      }
    },

    closeChange(e) {
      if (this.status == "yq") {
        // 接受邀请
        let obj = {};
        obj.payPassword = e;
        obj.shop_evaluation_id = this.AcceptEval.shop_evaluation_id;
        obj.share_user_id = this.AcceptEval.to_user_id;
        obj.user_id = uni.getStorageSync("userId");
        obj.is_accept = 1;
        this.$u.api.shopEvaluationOrderAdd(obj).then(res => {
          wx.setStorageSync('eval_orderid', res.data.id);
          //添加步骤描述
          let ors = {};
          ors.eval_orderid = res.data.id;
          ors.describe = "用户已报名,请商家及时确实.";
          ors.user_id = uni.getStorageSync("userId");
          ors.shop_userid = this.AcceptEval.to_user_id;
          ors.types = 0;
          this.$u.api.setStepDescribe(ors).then(res => {
          })
          // 推送消息
          let arr = {};
          arr.user_id = this.AcceptEval.to_user_id;
          arr.title = "确认邀请提醒";
          arr.content = "您发出" + res.data.ShopEvaluation.title + "的测评邀请用户已确认,请及时付款.";
          arr.payload = "/pages/pagethree/pages/myCreation/myCreation?form=shop&type=0";
          this.$u.api.appMessagePush(arr).then(res => {
          })

          this.$refs.uToast.show({
            title: "已接受，请等待商家确认",
            type: "success",
            duration: 2000
          })
          this.getAcceptEval();
        }).catch(err => {
          console.log(err)
          if (err.message == "请先设置支付密码") {
            uni.navigateTo({
              url: "/pages/pageone/pages/ChangePassword1/ChangePassword1"
            })
          } else if (err.message == "您尚未认证名片") {
            uni.navigateTo({
              url: "/pages/pagefour/pages/real/real"
            })
          }
        })
      } else if (this.status == "qr") {
        // 商家确认
        this.sureOrderData.pay_password = e;
        this.sureOrderFun();
      }
    },

    //确认邀请
    toConfrim() {
      let AcceptEval = this.AcceptEval
      console.log(AcceptEval)
      this.status = 'yq';
      this.$refs.numberPad.open("需冻结" + AcceptEval.evalinfo.frozen_money + "元");
    },
    //拒绝邀请
    toCancel() {
      let AcceptEval = this.AcceptEval
      let obj = {};
      obj.user_id = AcceptEval.user_id;
      obj.shop_evaluation_id = AcceptEval.shop_evaluation_id;
      obj.otheruid = AcceptEval.to_user_id;
      this.$u.api.evaluationRefuse(obj).then(res => {
        // setTimeout(()=>{
        this.$refs.uToast.show({
          title: res.message,
          type: "success",
          duration: 2000
        })
        // },1000)
        this.getAcceptEval();
      })
    },

    sureOrder(e) {
      let id = e.target.dataset.id || e.currentTarget.dataset.id;
      let money = e.target.dataset.money || e.currentTarget.dataset.money;
      let arr = [];
      // #ifdef MP-WEIXIN
      arr = ["微信支付", "余额支付"];
      // #endif
      // #ifdef APP
      arr = ["支付宝支付", "微信支付", "余额支付"];
      // #endif
      uni.showActionSheet({
        itemList: arr,
        success: res => {
          let obj = {};
          obj.id = id;
          obj.user_id = uni.getStorageSync("userId");
          // #ifdef MP-WEIXIN
          if (res.tapIndex == 0) {
            obj.pay_type = 10;
            this.sureOrderData = obj;
            this.sureOrderFun();
          } else if (res.tapIndex == 1) {
            obj.pay_type = 40;
            this.status = "qr";
            this.sureOrderData = obj;
            this.$refs.numberPad.open("需支付" + money + "元");
          }
          // #endif
          // #ifdef APP
          if (res.tapIndex == 0) {
            obj.pay_type = 30;
            this.sureOrderData = obj;
            this.sureOrderFun();
          } else if (res.tapIndex == 1) {
            obj.pay_type = 20;
            this.sureOrderData = obj;
            this.sureOrderFun();
          } else if (res.tapIndex == 2) {
            obj.pay_type = 40;
            this.status = "qr";
            this.sureOrderData = obj;
            this.$refs.numberPad.open("需支付" + money + "元");
          }
          // #endif
        }
      })
    },
    sureOrderFun() {
      this.$u.api.shopEvaluationOrderConfirm(this.sureOrderData).then(res => {
        //支付成功添加描述
        let ors = {};
        ors.eval_orderid = this.AcceptEval.order_info.id;
        // ors.describe = "商家已付款";
        ors.shop_userid = uni.getStorageSync("userId");
        // ors.shop_userid = this.AcceptEval.to_user_id;
        ors.types = 1;
        this.$u.api.setStepDescribe(ors).then(res => {
        })
        //推送消息
        this.$u.api.shopEvaluationOrderDetails({
          id: this.AcceptEval.order_info.id
        }).then(res => {
          let objsend = {};
          objsend.user_id = this.AcceptEval.user_id;
          objsend.title = "确认消息";
          objsend.content = '请登记预约信息-商户已确认并支付稿费到平台，请及时与商户沟通并预约门店和日期';
          objsend.payload = `/pages/pagethree/pages/myCreation/myCreation?form=user&type=0`;
          app.$vm.sendPushMes(objsend);
        });

        if (this.sureOrderData.pay_type == 10 || this.sureOrderData.pay_type == 20) {
          wxPayment(res.data).then(rep => {
            this.$refs.uToast.show({
              title: "支付成功",
              type: "success",
              duration: 2000
            })
            this.getAcceptEval();
          });
        } else if (this.sureOrderData.pay_type == 30) {
          zfbPayment(res.data).then(rep => {
            this.$refs.uToast.show({
              title: "支付成功",
              type: "success",
              duration: 1000
            })
            this.getAcceptEval();
          })
        } else if (this.sureOrderData.pay_type == 40) {
          this.$refs.uToast.show({
            title: "支付成功",
            type: "success",
            duration: 2000
          })
          this.getAcceptEval();
        }
      })
    },
    getDayTime(time) {
      let min = Math.floor(time / 60);
      let sec = time % 60;
      let hour = Math.floor(min / 60);
      let mins = min % 60;
      return hour + "时" + mins + "分" + sec + "秒";
    },
    // 选择时间
    selectTime(e) {
      let id = e.target.dataset.id || e.currentTarget.dataset.id;
      let pid = e.target.dataset.pid || e.currentTarget.dataset.pid; //测评id
      this.orderIds = id;
      this.appointment_time = Math.floor(new Date(e.detail.value).getTime() / 1000);
      uni.$on("confirmTime", (shopId) => {
        let obj = {};
        obj.id = this.orderIds;
        obj.appointment_time = this.appointment_time;
        obj.shop_id = shopId;
        obj.user_id = uni.getStorageSync("userId");
        console.log(obj)
        this.$u.api.shopEvaluationOrderUserConfirmAppointmentTime(obj).then(res => {
          //预约到店添加描述
          let ors = {};
          ors.eval_orderid = this.AcceptEval.order_info.id;
          ors.user_id = uni.getStorageSync("userId");
          // ors.shop_userid = this.AcceptEval.to_user_id;
          ors.types = 2;
          this.$u.api.setStepDescribe(ors).then(res => {
          })
          //推送消息
          this.$u.api.shopEvaluationOrderDetails({
            id: this.AcceptEval.order_info.id
          }).then(re => {
            let objsend = {};
            let user = uni.getStorageSync("rmUser");
            objsend.user_id = re.data.business_id;
            objsend.title = "确认消息";
            objsend.content = '请确认用户预约信息' + user.username + '用户已预约，请及时确认';
            objsend.payload = `/pages/pagethree/pages/myCreation/myCreation?form=shop&type=0`;
            app.$vm.sendPushMes(objsend);
          });
          this.$refs.uToast.show({
            title: "已预约到店时间",
            type: "success",
            duration: 2000
          })
          this.getAcceptEval();
          uni.$off("confirmTime");
        })
      })
      uni.navigateTo({
        url: "/pages/pageone/pages/choiceStore/choiceStore?userid=" + pid //测评id
      })
    },
    //商家操作确认预约时间和需要修改时间
    sureAppoint(e) {
      let id = e.target.dataset.id || e.currentTarget.dataset.id;
      let type = e.target.dataset.type || e.currentTarget.dataset.type;
      let obj = {};
      obj.id = id;
      obj.user_id = uni.getStorageSync("userId")
      if (type == "refuse") {
        obj.is_agree = 2;
      } else {
        obj.is_agree = 1;
      }
      this.$u.api.shopEvaluationOrderShopRefuseAppointmentTime(obj).then(res => {
        if (type == "refuse") {
          //推送消息
          this.$u.api.shopEvaluationOrderDetails({
            id: id
          }).then(res => {
            let objsend = {};
            let user = uni.getStorageSync("rmUser");
            objsend.user_id = res.data.user_id;
            objsend.title = "驳回消息";
            objsend.content = '预约未成功，请与PR沟通后再次登记预约信息-谢谢参与！';
            objsend.payload =
                `/pages/pagethree/pages/myCreation/myCreation?form=user&type=0`;
            app.$vm.sendPushMes(objsend);
          });
          this.$refs.uToast.show({
            title: "已驳回预约",
            type: "success",
            duration: 2000
          })
        } else {
          //确认预约添加描述
          let ors = {};
          ors.eval_orderid = id;
          ors.shop_userid = uni.getStorageSync("userId");
          // ors.shop_userid = this.AcceptEval.to_user_id;
          ors.types = 3;
          this.$u.api.setStepDescribe(ors).then(res => {
          })
          //推送消息
          this.$u.api.shopEvaluationOrderDetails({
            id: id
          }).then(res => {
            let objsend = {};
            let user = uni.getStorageSync("rmUser");
            objsend.user_id = res.data.user_id;
            objsend.title = "确认消息";
            objsend.content = '请按时参与测评订单，商家' + user.username + '已确认预约时间,请按时参与！';
            objsend.payload =
                `/pages/pagethree/pages/myCreation/myCreation?form=user&type=0`;
            app.$vm.sendPushMes(objsend);
          });

          this.$refs.uToast.show({
            title: "已确认预约",
            type: "success",
            duration: 2000
          })
        }
        this.getAcceptEval();
      })
    },
    //确认到店
    sureToStoreFun(e) {
      let id = e.target.dataset.id || e.currentTarget.dataset.id;
      let obj = {};
      obj.id = id;
      obj.user_id = uni.getStorageSync("userId");
      // this.sureToStoreFlag = false;
      uni.chooseImage({
        count: 1,
        sourceType: ["camera"],
        sizeType: ["compressed"],
        success: result => {
          uni.showLoading({
            title: "上传中..."
          })
          app.$vm.updataAvator(result.tempFilePaths[0]).then(res => {
            // console.log(res)
            obj.arrival_image = res;
            // this.initMessage();
            // console.log(obj);return;
            this.$u.api.shopEvaluationOrderUserConfirmBePresent(obj).then(res => {
              uni.hideLoading()
              //确认到店添加描述
              let ors = {};
              ors.eval_orderid = id;
              ors.user_id = uni.getStorageSync("userId");
              // ors.shop_userid = this.AcceptEval.to_user_id;
              ors.types = 4;
              this.$u.api.setStepDescribe(ors).then(res => {
              })
              //推送消息
              this.$u.api.shopEvaluationOrderDetails({
                id: id
              }).then(res => {
                let objsend = {};
                let user = uni.getStorageSync("rmUser");
                objsend.user_id = res.data.business_id;
                objsend.title = "确认消息";
                objsend.content = '用户' + user.username +
                    '已到店,请确认用户已保存活动要求中所需的图片/视频素材！';
                objsend.payload =
                    `/pages/pagethree/pages/myCreation/myCreation?form=shop&type=0`;
                app.$vm.sendPushMes(objsend);
              });
              this.$refs.uToast.show({
                title: "已确认到店",
                type: "success",
                duration: 2000
              })
              this.getAcceptEval();
            })
          });
        },
        fail: err => {
          console.log(err)
          if (err.errMsg != 'chooseImage:fail cancel') {
            app.$vm.checkAuth("scope.camera").then(resultConfirm => {
              if (resultConfirm) {
                uni.showModal({
                  title: "系统繁忙，请稍后再试"
                })
              } else {
                uni.showModal({
                  title: "请检查摄像头和相册权限后重试"
                })
              }
            })
          }
        }
      })
    },
    //交稿
    toRelease(e) {
      let id = e.target.dataset.id || e.currentTarget.dataset.id;
      let ids = e.target.dataset.ids || e.currentTarget.dataset.ids;
      let toOtheruser_id = this.conversationID.slice(3);
      console.log(id)
      console.log(ids)
      if (ids) {
        uni.navigateTo({
          url: "/pages/pagefour/pages/Release/Release?id=" + ids + "&orderid=" + id +
              '&chat=1&otherid=' + toOtheruser_id
        })
      } else {
        uni.navigateTo({
          url: "/pages/pagefour/pages/Release/Release?orderid=" + id + '&chat=1&otherid=' +
              toOtheruser_id
        })
      }

    },
    //查看
    checkMsg(e) {
      let id = e.target.dataset.id || e.currentTarget.dataset.id;
      let type = e.target.dataset.type || e.currentTarget.dataset.type;
      // console.log(id)
      // console.log(type);return;
      if (!id) {
        this.$refs.uToast.show({
          title: "内容有误,请重新上传后再看",
          type: "error",
          duration: 2000
        })
        return false;
      }

      if (type == 1) {
        uni.navigateTo({
          url: "/pages/pagetwo/pages/FindDetail/FindDetail?id=" + id + '&type=' + true
        })
      } else {
        uni.navigateTo({
          url: "/pages/pagefive/pages/VideoDetail/VideoDetail?id=" + id + '&type=' + false
        })
      }
    },
    //需修改
    surePass(e) {
      let id = e.target.dataset.id || e.currentTarget.dataset.id;
      let type = e.target.dataset.type || e.currentTarget.dataset.type;
      let obj = {};
      obj.id = id;
      obj.user_id = uni.getStorageSync("userId");
      if (type == "refuse") {
        obj.is_confirm = 2;
      } else if (type == "pass") {
        obj.is_confirm = 1;
      }
      this.$u.api.shopEvaluationOrderShopConfirmShare(obj).then(res => {
        if (type == "refuse") {
          //推送消息
          this.$u.api.shopEvaluationOrderDetails({
            id: id
          }).then(res => {
            let objsend = {};
            let user = uni.getStorageSync("rmUser");
            objsend.user_id = res.data.user_id;
            objsend.title = "驳回消息";
            objsend.content = '请修改稿件后再次提交-' + res.data.ShopEvaluation.title +
                '稿件被驳回，请查看活动详情72小时内补充后再次提交，超时订单将扣除冻结款项支付给商家自动完结，请及时交稿。';
            objsend.payload =
                `/pages/pagethree/pages/myCreation/myCreation?form=user&type=0`;
            app.$vm.sendPushMes(objsend);
          });

          this.$refs.uToast.show({
            title: "已驳回稿件",
            type: "success",
            duration: 2000
          })
        } else if (type == "pass") {
          //确认稿件添加描述
          let ors = {};
          ors.eval_orderid = id;
          ors.shop_userid = uni.getStorageSync("userId");
          // ors.shop_userid = this.AcceptEval.to_user_id;
          ors.types = 6;
          this.$u.api.setStepDescribe(ors).then(res => {
          })
          //推送消息
          this.$u.api.shopEvaluationOrderDetails({
            id: id
          }).then(res => {
            let objsend = {};
            let user = uni.getStorageSync("rmUser");
            objsend.user_id = res.data.user_id;
            objsend.title = "提醒消息";
            objsend.content = '请及时发布作品-' + res.data.ShopEvaluation.title +
                '稿件审核已通过，请及时发布第三方平台后点击（我已发布）';
            objsend.payload =
                `/pages/pagethree/pages/myCreation/myCreation?form=user&type=0`;
            app.$vm.sendPushMes(objsend);
          });

          this.$refs.uToast.show({
            title: "已确认稿件",
            type: "success",
            duration: 2000
          })
        }
        this.getAcceptEval();
      })
    },
    //我已发布
    sureRelease(e) {
      let id = e.target.dataset.id || e.currentTarget.dataset.id;
      let obj = {};
      obj.id = id;
      obj.user_id = uni.getStorageSync("userId");
      this.$u.api.shopEvaluationOrderUserConfirmRelease(obj).then(res => {
        //发布添加描述
        let ors = {};
        ors.eval_orderid = id;
        ors.user_id = uni.getStorageSync("userId");
        // ors.shop_userid = this.AcceptEval.to_user_id;
        ors.types = 7;
        this.$u.api.setStepDescribe(ors).then(res => {
        })
        //推送消息
        this.$u.api.shopEvaluationOrderDetails({
          id: id
        }).then(res => {
          let objsend = {};
          let user = uni.getStorageSync("rmUser");
          objsend.user_id = res.data.business_id;
          objsend.title = "发布消息";
          objsend.content = '请确认查收-' + res.data.ShopEvaluation.title + '-' + user.username +
              '用户稿件已发布，请及时查收。不要让用户久等哦～';
          ;
          objsend.payload = `/pages/pagethree/pages/myCreation/myCreation?form=shop&type=0`;
          app.$vm.sendPushMes(objsend);
        });

        this.$refs.uToast.show({
          title: "已确认发布",
          type: "success",
          duration: 2000
        })
        this.getAcceptEval();
      })
    },
    //稿件异常
    noOver(e) {
      let id = e.target.dataset.id || e.currentTarget.dataset.id;
      let obj = {};
      obj.id = id;
      obj.user_id = uni.getStorageSync("userId");
      this.$u.api.shopEvaluationOrderShopReject(obj).then(res => {
        //推送消息
        this.$u.api.shopEvaluationOrderDetails({
          id: id
        }).then(res => {
          let objsend = {};
          let user = uni.getStorageSync("rmUser");
          objsend.user_id = res.data.user_id;
          objsend.title = "查收异常";
          objsend.content = '查收异常-' + res.data.ShopEvaluation.title +
              '发布内容商家查收异常，请检查所发布的账户、平台、关联店铺等信息发布后再次点击；如确认无误请点击（申述）';
          objsend.payload = `/pages/pagethree/pages/myCreation/myCreation?form=user&type=0`;
          app.$vm.sendPushMes(objsend);
        });
        this.$refs.uToast.show({
          title: "已驳回",
          type: "success",
          duration: 2000
        })
      })
      this.getAcceptEval();
    },
    //已完成
    sureOver(e) {
      let id = e.target.dataset.id || e.currentTarget.dataset.id;
      let obj = {};
      obj.id = id;
      obj.user_id = uni.getStorageSync("userId");
      this.$u.api.shopEvaluationOrderShopConfirmRelease(obj).then(res => {
        //商户待发布添加描述
        let ors = {};
        ors.eval_orderid = id;
        ors.shop_userid = uni.getStorageSync("userId");
        // ors.shop_userid = this.AcceptEval.to_user_id;
        ors.types = 8;
        this.$u.api.setStepDescribe(ors).then(res => {
        })
        //推送消息
        this.$u.api.shopEvaluationOrderDetails({
          id: id
        }).then(res => {
          let objsend = {};
          let user = uni.getStorageSync("rmUser");
          objsend.user_id = res.data.user_id;
          objsend.title = "发布消息";
          objsend.content = "稿费到账通知" + res.data.ShopEvaluation.title + "-" + user.username +
              "${达人若免昵称}活动已完成，稿费已到账冻结账户，7天后将与商品押金同步自动解冻！谢谢参与！"
          objsend.payload = `/pages/pagethree/pages/myCreation/myCreation?form=user&type=0`;
          app.$vm.sendPushMes(objsend);
        });


        this.$refs.uToast.show({
          title: "已确认完结",
          type: "success",
          duration: 2000
        })
      })
    },
    ltUpdateMyInfo() {
      // if(this.globalData.isSDKReady === true){
      if (!uni.getStorageSync("userId")) {
        return false;
      }
      this.$u.api.userDetails({
        user_id: uni.getStorageSync("userId")
      }).then(res => {
        let userdetail = res.data;
        let userInfo = {
          fbNickName: userdetail.username,
          fbAvatarUrl: userdetail.image_url
        }
        // 修改个人标配资料
        let promise = uni.$TUIKit.updateMyProfile({
          nick: userInfo.fbNickName,
          avatar: userInfo.fbAvatarUrl,
          // allowType: uni.$TIM.TYPES.ALLOW_TYPE_ALLOW_ANY
        });
        promise.then(function (imResponse) {
        }).catch(function (imError) {
        });
      })

      // }
    },
  }
};
</script>
<style>
@import './chat.css';
</style>
